<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>  
<html>  
    <head>  
    <meta charset="utf-8">  
    <title>数据源配置</title>  
	    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/default/easyui.css" />
	    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/icon.css" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
   		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.1.2.2.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/locale/easyui-lang-zh_CN.js"></script>
	 	<script type="text/javascript">
			$(function(){
				
			});
			
			function addExcGroup(){
				if(!checkForm()){
					$.messager.alert('提示',"请填入基本信息","warning");
					return;
				}
				$.ajax({
					url:'${pageContext.request.contextPath}/edi/addExcGroup',
					type:'post',
					data:$('#groupForm').serialize(),
					success:function(data){
						if(data.info == 'UpdateSuccess'){
							$.messager.alert('提示',"更新成功");
						}else if(data.info == 'SaveSuccess'){
							$.messager.alert('提示',"保存成功");
							$('input[name=groupId]').val(data.msg);
						}else{
							$.messager.alert('提示',data.info);
						}
					}
				});
			}
			
			function checkForm(){
				if($('input[name=groupName]').val()!='' && 
					$('select[name=dataSourceType]').val()!='00'){
					return true;
				}
				return false;
			}
	 	</script>
    </head>  
    <body>  
    	<!-- 数据源配置界面 -->
    	<form id="groupForm">
	    	<table>
	    		<tr>
	    			<td>分组名:</td>
	    			<td colspan="3" style="width:465px;"><input name='groupName' style="width:100%" /><input name='groupId' style="display: none;"/></td>
	    		</tr>
	    		<tr>
	    			<td>站点:</td>
	    			<td style="width:175px;">
	    				<select style="width:100%" name='stationId'>
	    					<option value='st001'>爱你特</option>
	    				</select>
	    			</td>
	    			<td>数据源类型:</td>
	    			<td>
	    				<select style="width:100%"  name='dataSourceType'>
	    					<option value='00'>==请选择==</option>
	    					<option value='1'>TXT</option>
	    					<option value='2'>XML</option>
	    					<option value='3'>数据库</option>
	    				</select>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td>用户名:</td>
	    			<td colspan="3"><input name='userName' style="width:100%" /></td>
	    		</tr>
	    		<tr>
	    			<td>密码:</td>
	    			<td colspan="3"><input name='passwd' style="width:100%"  /></td>
	    		</tr>
	    		<tr>
	    			<td>URL:</td>
	    			<td colspan="3"><input name='url' style="width:100%"  /></td>
	    		</tr>
	    		<tr>
	    			<td>备注:</td>
	    			<td colspan="3"><textarea name='memo' cols="55" rows="3"></textarea></td>
	    		</tr>
	    		<tr><td colspan="4"><input value='保存' type="button" onclick="addExcGroup()"/></td></tr>
	    	</table>
    	</form>
	</body>  
</html>  